<template>
  <div>
    <img :src="movie.pic" alt="">
    <div>{{movie.title}}</div>
    <p><button @click="handleClick">跳转回首页</button></p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      movie:""
    }
  },
  methods: {
    handleClick() {
      this.$router.back();
    },
  },
  mounted(){
    var {id} = this.$route.params;
    console.log(id);
    this.$http(`http://47.108.197.28:4000/api/movieDetail?id=${id}`).then(res=>{
      console.log(res.data.res[0]);
      this.movie=res.data.res[0]
    })
  }
};
</script>

<style>
</style>